Producers of motion video programs use a variety of special effects to produce a final product. A graphics editor performs the task of adding special effects to motion video segments using a graphics workstation.
Feathering is a special effect that blurs one or more portions of a video frame. Feathering often is used when creating a composite video frame from a foreground image and a background image. The graphics editor feathers the border between the images thereby blending the images together to create an effect that the two images are truly one image. As a result an object of the foreground image appears disposed within the background image. For example, a composite frame including a foreground image of two people walking and a background image of a desert scene, when feathered, provides an appearance of the two people walking in the desert.
The graphics editor generally manipulates a number of frames to create a composite frame, as illustrated in FIG. 1. Typically, the graphics editor takes a foreground image 24 from a first frame 20, and a background image 26 from a second frame 28, and combines them using a matte image in a matte frame 32 to form a composite frame 38. The matte image is a gray scale image that the graphics workstation uses when generating the composite frame 38. In particular, the light area of the matte image indicates to the graphics workstation that the area 24 of the first frame 20 is to be used as the foreground image, and that the area 22 is to be ignored. Similarly, the dark area 36 of the matte image indicates that the area 26 of the second frame 28 is to be used as the background image.
Before generating the composite frame 38, the graphics editor modifies the matte image so that the graphics workstation generates a feathering effect between the foreground and background images 24 and 26. In particular, the border area between the light and dark area of the matte image is filtered. If the matte image uses a gray scale that ranges between 0 and 255, the dark area for the background is 0, the light area for the foreground is 255, and the border area between the dark area and light area has values between 0 and 255 depending on the type of filtering applied to the matte image. The degree of realism in the composite frame 38 often depends on the type of filtering. When filtering is poor, the viewer can identify a border 36 between the foreground image and the background image so that the effect of interaction between objects in the two images is diminished or lost.
One conventional filter is a box filter which is commonly implemented as a finite impulse response filter (FIR). When a graphics editor filters a matte image through a box filter, the graphics editor identifies a border area in the matte image, and applies the box filter to each pixel of the border area. FIG. 2 illustrates a 3.times.1 box filter function. According to this box filtering function, a presently processed pixel value P.sub.a is set equal to an average of pixel values P.sub.a-1, P.sub.a and P.sub.a+1. Each pixel value is equally weighted as indicated by the flat slope of the box filtering function.
Filtering can be applied in two dimensions. FIG. 3 illustrates a 3.times.3 box filtering function. Here the value of the center pixel is set to be the average of the values of the center pixel and the eight surrounding pixels, and the value of each pixel is equally weighted.
Another type of filter is a Gaussian filter which is also commonly implemented as an FIRS The Gaussian filter uses a Gaussian curve, as illustrated in FIG. 4. The Gaussian filter weights each pixel according to its proximity to the pixel being processed, i.e., the center pixel. FIG. 4 shows a 3.times.1 Gaussian filter that weights the pixel P.sub.a by more than the adjacent pixels P.sub.a-1 and P.sub.a+1. A Gaussian filter can be implemented as a two pass FIR, one pass for the horizontal direction, and one pass for the vertical direction.
Producing composite frames using such filtering techniques has certain drawbacks. In particular, using a conventional box filtered matte image to create a feathered composite frame typically provides unsatisfactory results, i.e., the composite frame does not provide a realistic appearance of interaction between objects in the foreground and background images of the composite frame. Also, box filtering provides biased results when the width of the filter is defined by an even number of pixels. For example, a typical 4.times.1 box filter processes the present pixel, one pixel to the left of the present pixel, and two pixels to the right of the present pixel. This unbalanced use of image data effectively shifts the results by half a pixel, and may be noticeable to the viewer. In particular, when playing a sequence of frames, portions of the video image may appear to jitter due to box filtering using an even width box filter.
A composite frame generated from a Gaussian filtered matte image generally provides suitable results. That is, the composite frame provides a realistic appearance that objects in the foreground image are disposed within the background image. However, Gaussian filtering requires a substantial amount of processing time since each pixel value must be multiplied by a weighted coefficient. For example, a 32.times.32 Gaussian filter operating on a 132 MHZ Power PC available from Apple Computer of Cupertino, California, requires approximately 1.5 minutes to filter completely a typical matte image having a dimension of 720.times.486 pixels. Accordingly, Gaussian filtering is impractical for feathering frame sequences of 100 frames or even 1000 frames as often desired in the movie and television industries. Furthermore, as the width of the Gaussian filter increases, processing time increases. In particular, each pixel increase in the width of a Gaussian filter adds one multiply operation per pass and one add operation per pass for each pixel to be processed.